package main

import (
	"fmt"
	"strings"
)

type Part struct {
	Id int
	Name string 
}

// 转换成小写
func (p *Part) LowerCase() {
	p.Name = strings.ToLower(p.Name) 
}

// 转换成大写
func (p *Part) UpperCase() {
	p.Name = strings.ToUpper(p.Name)
}

// 按格式打印
func (p Part)String() string {
	return fmt.Sprintf("Id: %d, Name: %s\n", p.Id, p.Name)
}

func main() {
	part := Part{5, "WYatt"}
	part.LowerCase()
	fmt.Println(part)

	// 修改id值，再进行打印
	part.Id += 14
	part.UpperCase()
	fmt.Println(part)
}

